const {setToken} = require('./../../utils/jwt')

const login = async (req, res) => {
    let username = req.body.username
    let password = req.body.password

    /**
     * 通过密码和用户名在数据库查询用户,将查出来的用户名和id给setToken发给前端
     */

    console.log('ok')

    let token = await setToken(username,12)
    res.send({
        status: 200,
        msg: "aba aba aba",
        data: {
            username,
            password,
            token
        }
    })
}

module.exports = login